/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.modelo;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author Gilberto
 */
@Entity
@Table(name = "ecf_cheque_cliente")
@NamedQueries({
    @NamedQuery(name = "ChequeCliente.findAll", query = "SELECT c FROM ChequeCliente c")})
public class ChequeCliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "NUMERO_CHEQUE")
    private Integer numeroCheque;
    @Column(name = "DATA_CHEQUE")
    @Temporal(TemporalType.DATE)
    private Date dataCheque;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "VALOR_CHEQUE")
    private BigDecimal valorCheque;
    @Lob
    @Column(name = "OBSERVACOES")
    private String observacoes;
    @JoinColumn(name = "ID_BANCO", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Banco idBanco = new Banco();
    @JoinColumn(name = "ID_CLIENTE", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private Cliente idCliente = new Cliente();

    public ChequeCliente() {
    }

    public ChequeCliente(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNumeroCheque() {
        return numeroCheque;
    }

    public void setNumeroCheque(Integer numeroCheque) {
        this.numeroCheque = numeroCheque;
    }

    public Date getDataCheque() {
        return dataCheque;
    }

    public void setDataCheque(Date dataCheque) {
        this.dataCheque = dataCheque;
    }

    public BigDecimal getValorCheque() {
        return valorCheque;
    }

    public void setValorCheque(BigDecimal valorCheque) {
        this.valorCheque = valorCheque;
    }

    public String getObservacoes() {
        return observacoes;
    }

    public void setObservacoes(String observacoes) {
        this.observacoes = observacoes;
    }

    public Banco getIdBanco() {
        return idBanco;
    }

    public void setIdBanco(Banco idBanco) {
        this.idBanco = idBanco;
    }

    public Cliente getIdCliente() {
        return idCliente;
    }

    public void setIdCliente(Cliente idCliente) {
        this.idCliente = idCliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ChequeCliente)) {
            return false;
        }
        ChequeCliente other = (ChequeCliente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.classes.ChequeCliente[ id=" + id + " ]";
    }
    
}
